color10 2.2.1
color10.h File Reference

This file contains API for Color 10 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  color10_t
 Click ctx object definition. More...
struct  color10_cfg_t
 Click configuration structure definition. More...

Macros

#define COLOR10_MAP_MIKROBUS(cfg, mikrobus)
#define COLOR10_RETVAL   uint8_t
#define COLOR10_OK   0x00
#define COLOR10_INIT_ERROR   0xFF
#define COLOR10_SLAVE_ADDR   0x10
#define COLOR10_CMD_REG_CFG   0x00
#define COLOR10_CMD_REG_C   0x04
#define COLOR10_CMD_REG_R   0x05
#define COLOR10_CMD_REG_G   0x06
#define COLOR10_CMD_REG_B   0x07
#define COLOR10_CMD_REG_IR   0x08
#define COLOR10_CMD_REG_ID   0x0C
#define COLOR10_DEVICE_ID   0x28
#define COLOR10_COLOR_ORANGE   0x11
#define COLOR10_COLOR_RED   0x22
#define COLOR10_COLOR_PINK   0x33
#define COLOR10_COLOR_PURPLE   0x44
#define COLOR10_COLOR_BLUE   0x55
#define COLOR10_COLOR_CYAN   0x66
#define COLOR10_COLOR_GREEN   0x77
#define COLOR10_COLOR_YELLOW   0x88
#define COLOR10_COLOR_OTHER   0x99
#define COLOR10_CFG_HIGH_DYNAMIC_RANGE_1_3   0x0040
#define COLOR10_CFG_HIGH_DYNAMIC_RANGE_1   0x0000
#define COLOR10_CFG_INTEGRATION_TIME_SETT_50_MS   0x0000
#define COLOR10_CFG_INTEGRATION_TIME_SETT_100_MS   0x0010
#define COLOR10_CFG_INTEGRATION_TIME_SETT_200_MS   0x0020
#define COLOR10_CFG_INTEGRATION_TIME_SETT_400_MS   0x0030
#define COLOR10_CFG_AUTO_MODE   0x0000
#define COLOR10_CFG_FORCE_MODE   0x0008
#define COLOR10_CFG_TRIGGER_NO   0x0000
#define COLOR10_CFG_TRIGGER_ONE_TIME   0x0004
#define COLOR10_CFG_POWER_ON   0x0000
#define COLOR10_CFG_SHUT_DOWN   0x8001
#define COLOR10_CFG_POWER_ON_G_C_IR   0x4000
#define COLOR10_CFG_GAIN_1_X1   0x0000
#define COLOR10_CFG_GAIN_1_X2   0x1000
#define COLOR10_CFG_GAIN_1_X4   0x2000
#define COLOR10_CFG_GAIN_2_X1_2   0x0C00
#define COLOR10_CFG_GAIN_2_X1   0x0000
#define COLOR10_CFG_GAIN_2_X2   0x0400
#define COLOR10_CFG_GAIN_2_X4   0x0800

Functions

void color10_cfg_setup (color10_cfg_t *cfg)
 Config Object Initialization function.
COLOR10_RETVAL color10_init (color10_t *ctx, color10_cfg_t *cfg)
 Initialization function.
void color10_generic_write (color10_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
uint16_t color10_generic_read (color10_t *ctx, uint8_t cmd_addr)
 Generic read function.
void color10_config (color10_t *ctx, uint16_t cfg_data)
 Configuration function.
uint8_t color10_get_id (color10_t *ctx)
 ID retrieval function.
float color10_read_color_ratio (color10_t *ctx, uint8_t color_cmd_reg)
 Color ratio function.
float color10_get_color_value (color10_t *ctx)
 Color value function.
uint8_t color10_get_color (float color_value)
 Color retrieval function.

Detailed Description

This file contains API for Color 10 Click driver.